/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bagtest;

/**
 *
 * @author haoliang.donghl
 */
public class Item implements Comparable<Item>{
    private float size;
    private float value;
    private int newSize;
    private float density;

    public float getSize() {
        return size;
    }

    public void setSize(float size) {
        this.size = size;
    }

    public float getValue() {
        return value;
    }

    public void setValue(float value) {
        this.value = value;
    }

    public float getDensity() {
        return density;
    }

    public void setDensity(float density) {
        this.density = density;
    }

    public int getNewSize() {
        return newSize;
    }

    public void setNewSize(int newSize) {
        this.newSize = newSize;
    }

    public int compareTo(Item item) {
           if (density < item.density){
            return 1;
           }else if (density > item.density){
            return -1;
           }
           return 0;
    }


}
